home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13709 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  28 lines

  1. Newsgroups: comp.lang.c
  2. Path: news.inap.net!news1!ind-009-237-118
  3. From: dlmiller@iquest.net (Doug Miller)
  4. Subject: Re: making #define's to be seen across files
  5. X-Nntp-Posting-Host: ind-009-237-118.iquest.net
  6. Message-ID: <DpM3y5.87E@iquest.net>
  7. Sender: news@iquest.net (News Admin)
  8. Organization: IQuest Network Services
  9. X-Newsreader: News Xpress Version 1.0 Beta #2.1
  10. References: <1996Apr9.164443.28709@relay.nswc.navy.mil>
  11. Date: Tue, 9 Apr 1996 20:39:45 GMT
  12.  
  13. dheffel@vitds2.nswc.navy.mil (David R. Heffelfinger) wrote:
  14. >Hi there,
  15. >    There is (hopefully) a simple answer to my question:
  16. >
  17. >I have some C code divided into different source files.
  18. >When I try to compile using
  19. >  "cc file1.c file2.c file3.c"
  20. >the constants #define'd in file1.c are not visible in file2.c, is there a way to make them visible to the other source files?  In other words, is there som equivalent to "extern" for constants?
  21. >
  22. >Any help will be deeply appreciated.
  23. >
  24. >Heffel
  25. >
  26. >
  27. You could put them in a .h file which you then #include in each source file.
  28.